// import logo from './logo.svg';
import './App.css';
// import Holle from './hlooe/holle';

// import Footer from './conmpoent/footer/index'
// import List from './conmpoent/list/index'
// import '../src/hlooe/holle.css'//样式文件，可以都引入到一个里面
import { NavLink, useRoutes } from 'react-router-dom'
import elements from './router/index.js'
import Sercher from './conmpoentAxios/sercher/index'
import { useState } from 'react'
import React from 'react';


function App() {
  const element = useRoutes(elements)
  // // const datas= useState('')
  const [states, newstate] = useState([
    { id: 999, name: "sadsssssss撒多", done: false }
  ]
  )
  // const getchange = (id, change) => {//完成
  //   var lists = states.concat();
  //   // console.log(changgedata,"changgedata");
  //   lists.map(item => {
  //     if (item.id == id) {
  //       return item.done = changec
  //     }
  //   })
  //   // const newstate=states
  //   newstate(lists)
  // }

  // const ADDdata = (code) => {//添加数据
  //   // console.log([code, ...states], "?????????");
  //   var lists = states.concat();
  //   newstate([code, ...lists])

  //   // console.log(code,state);


  // }
  // const delettodo = (id) => {// 删除数据
  //   var lists = states.concat();
  //   lists.map((item, index) => {
  //     if (id == item.id) {
  //       lists.splice(index, 1)
  //     }

  //   })
  //   // console.log(lists === states);
  //   newstate([...lists])
  //   // console.log(newtodo, "states");

  // }
  // const alltodo = (state) => {
  //   const lists = JSON.parse(JSON.stringify(states));
  //   // var lists = states.concat();
  //   lists.map((item, index) => {
  //     item.done = state
  //   })
  //   // console.log(lists === states);
  //   newstate(lists)
  // }
  // const alltodoDel = () => {
  //   const lists = JSON.parse(JSON.stringify(states));
  //   const newlists=[]
  //   lists.map((item, index) => {
  //     if (!item.done) {\]]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\]\  //       newlists.push(item)
  //     }
  //   })
  //   newstate(newlists)
  // }

  // return (
  //   <div className="App">
  //     <Herder a={ADDdata} />
  //     <List todos={states} getchange={getchange} delettodoAPP={delettodo} />
  //     <Footer todos={states} alltodoAPP={alltodo} alltodoDelAPP={alltodoDel} />
  //   </div>
  // );



  return (
    <div className="App">



      <NavLink to={`/herder`} state={
        { id: states[0].id, name: states[0].name }
      }> Herder </NavLink>
      <NavLink to="/img"> img  </NavLink>
      <Sercher />
      {element}

    </div >
  );
}

export default App;
